home *** CD-ROM | disk | FTP | other *** search
/ GFX Sensations 1 / Graphic Sensations - Volume 1.iso / tools / amiga / 3d_tools / irit40s.lha / Irit / poly3d-r / program.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-30  |  3.6 KB  |  101 lines

  1. /*****************************************************************************
  2. * Definitions for the Poly3D-R program:                                      *
  3. *****************************************************************************/
  4.  
  5. #ifndef POLY_3D_R_H
  6. #define POLY_3D_R_H
  7.  
  8. #include "irit_sm.h"
  9. #include "genmat.h"
  10. #include "iritprsr.h"
  11. #include "attribut.h"
  12. #include "allocate.h"
  13. #include "gif_lib.h"
  14. #include "iritgrap.h"
  15. #include "cagd_lib.h"
  16.  
  17. #define DEFAULT_COLOR        15
  18. #define DEFAULT_BACK_GROUND_COLOR    1    /* Blue as default back ground. */
  19. #define RGB_COLOR_GIVEN            -1    /* Or if fill RGB was given. */
  20. #define DEFAULT_NORMAL_AVG_DEGREE    30       /* Less will be averaged. */
  21. #define DEFAULT_SAMPLE_PER_SRF_AXIS    20  /* Fineness srf subdiv. control. */
  22.  
  23. #define DEFAULT_SCREEN_XSIZE    320
  24. #define DEFAULT_SCREEN_YSIZE    200
  25.  
  26. #define DEFAULT_BITS_PER_PIXEL    7
  27. #define DEFAULT_LIGHT_SOURCE    { 1.0, 3.0, 7.0 }
  28. #define DEFAULT_AMBIENT        0.3
  29.  
  30. #define DEFAULT_FINENESS    4
  31.  
  32. typedef struct ShadeInfoStruct {
  33.     int SubSamplePixel;
  34.     int BitsPerPixel;         /* 2^BitsPerPixel == number of colors possible. */
  35.     int LevelsPerColor;        /* Number of levels per each required color. */
  36.     int DefaultColor;
  37.     int BackGroundColor;
  38.     int TwoSources;  /* If true - two sources at opposite direction assumed. */
  39.     int ScrnXSize;                   /* Rendered image dimensions. */
  40.     int ScrnYSize;
  41.     int Gouraud;                 /* If TRUE use Gouraud shading. */
  42.     int BackFacing;           /* If TRUE - delete back facing polygons. */
  43.     int *MinIntensityIndex;   /* Hold minimum intensity of this color index. */
  44.     GifColorType *PColorMap;
  45.     RealType LightSource[3];        /* Vector direction of light source. */
  46.     RealType Ambient;
  47.     RealType NrmlAvgDegree;
  48. } ShadeInfoStruct;
  49.  
  50. typedef struct ScanConvertStruct {
  51.     int MaxEdgeY;              /* When this edge is no longer active. */
  52.     struct IPVertexStruct *VMinY, *VMaxY; /* Which vertices form this bndry. */
  53. } ScanConvertStruct;
  54.  
  55. typedef struct PolygonScanConvertStruct {
  56.     ScanConvertStruct Bndry1, Bndry2;
  57. } PolygonScanConvertStruct;
  58.  
  59. /* The following are global setable variables (via config file poly3d-r.cfg).*/
  60. extern int GlblMore, MouseExists, GraphDriver;
  61. extern ShadeInfoStruct GlblShadeInfo;
  62.  
  63. /* Total number of polygons/vertices to scan converted, in current scene:    */
  64. extern int GlblNumOfPolys;
  65. extern int GlblNumOfVerts;
  66.  
  67. /* Used as global measure on the surfaces subdivision fineness. */
  68. extern int FineNess;
  69.  
  70. /* Amount scene was scaled up from normalized [-1..1] size on both X & Y:    */
  71. extern RealType GlblScaleUpFctr;
  72.  
  73. /* Global transformation matrix: */
  74. extern MatrixType GlblViewMat;              /* Current view of object. */
  75.  
  76. /* All polygons to be scan convert will be inserted into this hash table     */
  77. /* during the preprocessing (PrepareXXXX functions).                 */
  78. extern struct IPPolygonStruct **PolyHashTable;
  79.  
  80. /* And finally the prototypes of the Poly3D-H.c module: */
  81. IPPolygonStruct *ProcessSurfaces(CagdCrvStruct *Crvs, CagdSrfStruct *Srfs);
  82. void Poly3drExit(int ExitCode);
  83. void QuitGifError(void);
  84.  
  85. /* Prototypes of the PrepData.c module: */
  86. void PrepareViewData(IPObjectStruct *PObjects);
  87.  
  88. /* Prototypes of the ColorTbl.c module: */
  89. void PrepareColorTable(IPObjectStruct *PObjects);
  90.  
  91. /* Prototypes of the EvalColr.c module: */
  92. void EvalVrtxColors(IPObjectStruct *PObjects);
  93. int UpdateEqnPolygon(IPPolygonStruct *PPolygon, int SetFlipDir);
  94. int CrossProd(RealType Pt1[3], RealType Pt2[3], RealType Pt3[3]);
  95. void PrintPolyContent(IPPolygonStruct *PPoly);
  96.  
  97. /* Prototypes of the ScnCnvrt.c module: */
  98. void ScanConvertData(GifFileType *GifFile, GifFileType *GifMask);
  99.  
  100. #endif /* POLY_3D_R_H */
  101.